package com.rchat.pocmini.contact;

import com.airtalkee.sdk.entity.AirContact;

/**
 * Created by ljd on 2017/2/6.
 * <p>
 * 用户类，用以表示用户信息，如用户、组成员等对象
 */

public class PocContact implements PocContactInterface {

    //AirContact实例
    private AirContact airContact;


    //============= IN_CHAT_STATE状态值 ===========
    //用户参与了此会话
    public static final int IN_CHAT_STATE_ONLINE = AirContact.IN_CHAT_STATE_ONLINE;
    //用户未参与此会话
    public static final int IN_CHAT_STATE_OFFLINE = AirContact.IN_CHAT_STATE_OFFLINE;


    public PocContact() {
        airContact = new AirContact();
    }

    public PocContact(String ipocid, String name) {
        airContact = new AirContact(ipocid, name);
    }

    public PocContact(String ipocid, String name, int cursetype) {
        airContact = new AirContact(ipocid, name, cursetype);
    }

    public PocContact(int userId, String ipocId, String displayName, String tag, byte[] photo, String phoneNum, String email, String qq, String msn, String address, String birthday, int state, int age, String sessionCode) {
        airContact = new AirContact(userId, ipocId, displayName, tag, photo, phoneNum, email, qq, msn, address, birthday, state, age, sessionCode);
    }

    public PocContact(String ipocId, String displayName, String tag, int sex, byte[] photo, String phoneNum, String email, String qq, String msn, String address, String birthday, String sessionCode, int state) {
        airContact = new AirContact(ipocId, displayName, tag, sex, photo, phoneNum, email, qq, msn, address, birthday, sessionCode, state);
    }

    public PocContact(String ipocId, String displayName, String tag, int sex, byte[] photo, String phoneNum, String email, String qq, String msn, String address, String birthday, String sesssionCode, int state, String pwd) {
        airContact = new AirContact(ipocId, displayName, tag, sex, photo, phoneNum, email, qq, msn, address, birthday, sesssionCode, state, pwd);
    }

    /**
     * 获取AirContact实例
     *
     * @return airContact
     */
    public AirContact getAirContact() {
        return airContact;
    }

    /**
     * 获取用户id
     *
     * @return 用户id
     */
    @Override
    public int getUserId() {
        return airContact.getUserId();
    }

    /**
     * 获取用户名
     *
     * @return 用户名称
     */
    @Override
    public String getUserName() {
        return airContact.getUser();
    }

    /**
     * 获取用户在线状态
     *
     * @return 用户在线状态（参考CONTACT_STATE）
     */
    @Override
    public int getUserState() {
        return airContact.getState();
    }

    /**
     * 获取用户会话中的状态
     *
     * @return 用户会话中的状态（参考IN_CHAT_STATE）
     */
    @Override
    public int getUserStateInChat() {
        return airContact.getStateInChat();
    }
}
